package com.github_dididipapa.common.utils;

/**
 * @description: TimeUnit.SECONDS
 * @author: dididi_papa
 * @email: mitis1624087624@gmail.com
 * @date: 2025/07/31  17:48
 */
public enum RandomTime {
    RANDOM_SECONDS(1),
    RANDOM_MINUTES(60),
    RANDOM_HOURS(60 * 60),
    RANDOM_DAYS(60 * 60 * 24);

    private final long time;

    RandomTime(long base) {
        //0~10 的偏差
        // 生成一个0~10之间的随机数，并乘以base
        //随机数公式： (max - min + 1) + min
        this.time = (long) ((Math.random() * (10 + 1)) + (0)) * base;
    }

    public long getTime() {
        return time;
    }
}
